<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">

    <title>Document</title>
    <script src="./jquery.min.js"></script>
    <script src="./vue.js"></script>
</head>

<body>

<div id="story" style="width: 600px;border: solid;border-color:rgb(43, 137, 226);border-radius:1.5ex;">
   
    <div class="center" >
        <h1 class=" center">我爱的古诗词</h1>
        <input type="text" v-bind:value="poetry[0].value"><button id="show" type="button"
            @click="flag=!flag">{{flag?"收起":"展开"}}</button>
    </div>
    <div v-show="flag" v-for=" s in poetry" :key="s.name">
        {{s.value}}
    </div>

</div>

    <script>
        new Vue({
            el: "#story",
            data: {
                flag: false,
                poetry: [
                    { "name": "0", "value": "离思五首·其四" },
                    { "name": "1", "value": "曾经沧海难为水"}, 
                    { "name": "2", "value": "除却巫山不是云"}, 
                    { "name": "3", "value": "取次花丛懒回顾"}, 
                    { "name": "4", "value": "半缘修道半缘君"}, 
            ]}
        }) 
    </script>
</body>

</html>